#pragma once

#include <iostream>
#include <cstring>



class MsgNode 
{
    friend class Session;
public:
    //MsgNode为存储读取数据的节点时
    MsgNode(int total_len);
    //MsgNode为存储发送数据的节点时
    MsgNode(const char *msg, int total_len);
    ~MsgNode();
    void Clear()
    {
        _cur_len = 0;
        memset(_msg,0,_total_len);
    }

private:
    char *_msg;
    int _total_len;
    int _cur_len;


};

class RecvNode:public MsgNode{

public:
    RecvNode(short max_len,short msg_id);

private:
        short _msg_id;

};

class SendNode:public MsgNode{

public:
    SendNode(const char *msg, short max_len,short msg_id);
private:
        short _msg_id;

};